package edu.cuit.avatar.net;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/18 11:13
 */
public class Client {
    public static void main(String[] args) {
        //建立和服务器连接的套接字
        try(Socket socket = new Socket("127.0.0.1",8848)){
            var output = new DataOutputStream(socket.getOutputStream());
            output.writeFloat(5);
            var input = new DataInputStream(socket.getInputStream());
            var area = input.readFloat();
            System.out.println("服务器计算的圆面积:" + area);
        } catch (IOException e){

        }
    }
}
